<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript">
        // 编写一个js对象

        var user = {
            name: "张波",
            age: 21,
            sex: "男"
        };

        //将js对象转化成json对象
        let user2 = JSON.stringify(user);

        user3 = JSON.parse(user2);
        console.log(user)
        console.log(user2)
        console.log(user3)

    </script>
</head>
<body>

</body>
</html>